A FIFO for characters. Strings can be efficiently appended to the end,
and read from the beginning.
Example:
| Method Summary |
| |
__init__(self,
s)
|
| |
__len__(self)
Number of items in the deque. |
| |
__repr__(self)
|
| |
__str__(self)
|
| |
append(self,
s)
Append string data to the end of the buffer. |
| |
peek(self,
n)
Like read(), but do not remove the data that is returned. |
| |
prepend(self,
s)
Prepend string data to the beginning of the buffer. |
| |
read(self,
n)
Read n bytes of data (or less if less data available) from the
beginning of the buffer. |
| Inherited from Deque |
| |
_partition(self)
|
| |
pop_first(self)
Pop an item off the beginning of the deque, and return it. |
| |
pop_last(self)
Pop an item off the end of the deque, and return it. |
| |
push_first(self,
obj)
Prepend obj to the beginning of the deque. |
| |
push_last(self,
obj)
Append obj to the end of the deque. |